<?php
namespace app\baseinfo\controller;

class ProductTypes extends \app\common\controller\Base {
	protected $modelname='ProductType';

	protected function _index(){
		$condition=[];
		$param=$this->param;

		if (isset($param['type_no']))
			$condition[]=['type_no', '=',$param['type_no']];
		if (isset($param['name']))
			$condition[]=['name','like',"%".$param['name']."%"];
		if (isset($param['industry']))
			$condition[]=['industry','like',"%".$param['industry']."%"];
		if (isset($param['remark']))
			$condition[]=['remark','like',"%".$param['remark']."%"];

		return $condition;
	}

	protected function _order(&$field) {
		switch ($field) {
			case 'type_no':
			case 'name':
				return true;
			break;
		}
		return false;
	}
}

?>